function pe12() {
    var sum=0, i=1, count;
    var getNextTriangleNumber = function() {
        return sum=sum+i++;
    }
    
    var getDivisorCount = function(number) {
        var tmp = Math.floor(Math.sqrt(number))
        var count = 1;
        for(var i=1; i<tmp; i++) {
            if(number%i==0) count=count+2;
        }
        if(number%tmp==0) count=count+1;
        return count;
    }
    
    var tmp1, tmp2, tmp3;
    while(1) {
        var tmp1 = getNextTriangleNumber();
        count = getDivisorCount(tmp1)
        print(tmp1 + "...." + count);
        if(count>500) return tmp1
    }
}


print(pe12());
